/* 
 * File:   NWNXManager.h
 * Author: pixelord
 *
 * Created on 9 September 2012, 1:28 AM
 */

#ifndef NWNXMANAGER_H
#define	NWNXMANAGER_H
#include <string>
#include <iostream>
#include <fstream>

#include <planning/FF_PDDL_To_STRIPS.hxx>
#include <planning/STRIPS_Problem.hxx>
#include <heuristics/Max_Heuristic.hxx>
#include <heuristics/Relaxed_Plan_Extractor.hxx>
#include <planning/Types.hxx>
#include <inference/Propagator.hxx>
#include <search/Node.hxx>
#include <search/Best_First_Search.hxx>

#include <util/time.hxx>
#include <util/ext_math.hxx>

class NWNXManager
{
private:
    std::string domain_file;
    std::string instance_file;
    
    aig_tk::FF_PDDL_To_STRIPS adl_compiler;
    aig_tk::STRIPS_Problem strips_prob;
    aig_tk::Max_Heuristic estimator;
    
    aig_tk::Best_First_Search engine;
    
    std::vector<aig_tk::Node*> plan;
    
    unsigned int iCursor;
    //Function
    void readFile(char* _filename);
    void encode_as_text();
      
public:
    NWNXManager();
    ~NWNXManager();
    void loadPDDL();
    void printPlan(float t0, float tf);
    void buildPlan();
    std::string getNextAction();
};


#endif	/* NWNXMANAGER_H */

